package com.yanqu.road.entity.activity.pawnshop;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Objects;

/**
 * 玩家的当铺物件数据
 * 
 * @author sjh
 *
 */
@FieldTypeAnnotation(tableName = "t_u_activity_pawnshop_item")
public class UserPawnshopItem extends DataObject {

	@FieldTypeAnnotation(select = true, update = true, desc = "用户ID")
	private long userId;

	@FieldTypeAnnotation(select = true, update = true, desc = "活动ID")
	private int activityId;

	@FieldTypeAnnotation(update = true, desc = "物件ID=生成时的时间戳")
	private long itemId;

	@FieldTypeAnnotation(desc = "修复次数")
	private int repairTimes;

	@FieldTypeAnnotation(desc = "伪造星级：0即未伪造过，>0即伪造星级")
	private int fakeStar;
	private int opReceptionNum;   //操作时，接待人数，用来计算时间
	private int opStatus;         //操作状态， -1表示不存在 已售出，0：默认；1：修复中；2：伪造中；3：典当中

	@FieldTypeAnnotation(desc = "货物ID，即配表编号")
	private int goodsId;

	@FieldTypeAnnotation(desc = "等级")
	private int level;

	@FieldTypeAnnotation(desc = "稀有度")
	private int rarity;

	@FieldTypeAnnotation(desc = "状态")
	private int status;

	@FieldTypeAnnotation(desc = "进价，初始送的无进价")
	private long coinBuy;

	@FieldTypeAnnotation(desc = "年份词条编号")
	private int affixSn1;

	@FieldTypeAnnotation(desc = "形容词条编号")
	private int affixSn2;

	@FieldTypeAnnotation(desc = "特殊事件词条编号")
	private int affixSn3;

	@FieldTypeAnnotation(desc = "特殊人物词条编号")
	private int affixSn4;

	private long basePrice;           //物件基础价格
	private int statusEffectPrice;    //状态影响价格
	private int eventAffixAddition;   //事件词条加成
	private int personAffixAddition;  //人物词条加成
	private String descNo;

	// ========================================================================
	public long getUserId() {
		return userId;
	}
	public void setUserId(long userId) {
		if (this.userId != userId) {
			this.userId = userId;
			setUpdateOption();
		}
	}

	public int getActivityId() {
		return activityId;
	}
	public void setActivityId(int activityId) {
		if (this.activityId != activityId) {
			this.activityId = activityId;
			setUpdateOption();
		}
	}

	public long getItemId() {
		return itemId;
	}
	public void setItemId(long itemId) {
		if (this.itemId != itemId) {
			this.itemId = itemId;
			setUpdateOption();
		}
	}

	public int getRepairTimes() {
		return repairTimes;
	}

	public void setRepairTimes(int repairTimes) {
		if(this.repairTimes != repairTimes) {
			this.repairTimes = repairTimes;
			setUpdateOption();
		}
	}

	public int getFakeStar() {
		return fakeStar;
	}
	public void setFakeStar(int fakeStar) {
		if (this.fakeStar != fakeStar) {
			this.fakeStar = fakeStar;
			setUpdateOption();
		}
	}

	public int getOpReceptionNum() {
		return opReceptionNum;
	}

	public void setOpReceptionNum(int opReceptionNum) {
		if(this.opReceptionNum != opReceptionNum) {
			this.opReceptionNum = opReceptionNum;
			setUpdateOption();
		}
	}

	public int getOpStatus() {
		return opStatus;
	}

	public void setOpStatus(int opStatus) {
		if(this.opStatus != opStatus) {
			this.opStatus = opStatus;
			setUpdateOption();
		}
	}


	public int getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(int goodsId) {
		if(this.goodsId != goodsId) {
			this.goodsId = goodsId;
			setUpdateOption();
		}
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		if(this.level != level) {
			this.level = level;
			setUpdateOption();
		}
	}

	public int getRarity() {
		return rarity;
	}

	public void setRarity(int rarity) {
		if(this.rarity != rarity) {
			this.rarity = rarity;
			setUpdateOption();
		}
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		if(this.status != status) {
			this.status = status;
			setUpdateOption();
		}
	}

	public long getCoinBuy() {
		return coinBuy;
	}

	public void setCoinBuy(long coinBuy) {
		if(this.coinBuy != coinBuy) {
			this.coinBuy = coinBuy;
			setUpdateOption();
		}
	}

	public int getAffixSn1() {
		return affixSn1;
	}

	public void setAffixSn1(int affixSn1) {
		if(this.affixSn1 != affixSn1) {
			this.affixSn1 = affixSn1;
			setUpdateOption();
		}
	}

	public int getAffixSn2() {
		return affixSn2;
	}

	public void setAffixSn2(int affixSn2) {
		if(this.affixSn2 != affixSn2) {
			this.affixSn2 = affixSn2;
			setUpdateOption();
		}
	}

	public int getAffixSn3() {
		return affixSn3;
	}

	public void setAffixSn3(int affixSn3) {
		if(this.affixSn3 != affixSn3) {
			this.affixSn3 = affixSn3;
			setUpdateOption();
		}
	}

	public int getAffixSn4() {
		return affixSn4;
	}

	public void setAffixSn4(int affixSn4) {
		if(this.affixSn4 != affixSn4) {
			this.affixSn4 = affixSn4;
			setUpdateOption();
		}
	}

	public long getBasePrice() {
		return basePrice;
	}

	public void setBasePrice(long basePrice) {
		if(this.basePrice != basePrice) {
			this.basePrice = basePrice;
			setUpdateOption();
		}
	}

	public int getStatusEffectPrice() {
		return statusEffectPrice;
	}

	public void setStatusEffectPrice(int statusEffectPrice) {
		if(this.statusEffectPrice != statusEffectPrice) {
			this.statusEffectPrice = statusEffectPrice;
			setUpdateOption();
		}
	}

	public int getEventAffixAddition() {
		return eventAffixAddition;
	}

	public void setEventAffixAddition(int eventAffixAddition) {
		if(this.eventAffixAddition != eventAffixAddition) {
			this.eventAffixAddition = eventAffixAddition;
			setUpdateOption();
		}
	}

	public int getPersonAffixAddition() {
		return personAffixAddition;
	}

	public void setPersonAffixAddition(int personAffixAddition) {
		if(this.personAffixAddition != personAffixAddition) {
			this.personAffixAddition = personAffixAddition;
			setUpdateOption();
		}
	}

	public void setPawnshopItem(PawnshopItem pawnshopItem){
		if(null != pawnshopItem){
			setGoodsId(pawnshopItem.getGoodsId());
			setLevel(pawnshopItem.getLevel());
			setRarity(pawnshopItem.getRarity());
			setStatus(pawnshopItem.getStatus());
			setCoinBuy(pawnshopItem.getCoinBuy());
			setAffixSn1(pawnshopItem.getAffixSn1());
			setAffixSn2(pawnshopItem.getAffixSn2());
			setAffixSn3(pawnshopItem.getAffixSn3());
			setAffixSn4(pawnshopItem.getAffixSn4());
			setBasePrice(pawnshopItem.getBasePrice());
			setStatusEffectPrice(pawnshopItem.getStatusEffectPrice());
			setEventAffixAddition(pawnshopItem.getEventAffixAddition());
			setPersonAffixAddition(pawnshopItem.getPersonAffixAddition());
			setDescNo(pawnshopItem.getDescNo());
		}
	}

	public String getDescNo() {
		return descNo;
	}

	public void setDescNo(String descNo) {
		if (!Objects.equals(this.descNo, descNo)) {
			this.descNo = descNo;
			setUpdateOption();
		}
	}
}
